package com.qys.livesMall.system.controller.app;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.system.model.entity.H2ExchangeRate;
import com.qys.livesMall.system.service.IH2ExchangeRateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(description = "app-汇率查询", name = "AppExchangeRateController")
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/h2-exchange-rate")
@Slf4j
public class AppExchangeRateController {

    @Autowired
    private IH2ExchangeRateService service;

    @Operation(description = "汇率列表查询")
    @PostMapping("/listRate")
    public R<List<H2ExchangeRate>> listRate() {
        log.info("调用汇率查询接口！");
        return R.ok(service.list());
    }
}
